import React from "react";
import { queryColumn } from "../../services/new";
import UcCell from "../../components/uc-cell/uc-cell";
import { withRouter } from "react-router";
import Navheader from "../../components/Nav_header";
class Column extends React.Component {
    state = {
        column: []
    }
    async componentDidMount() {
        let { data: column } = await queryColumn();
        this.setState({ column })
    }

    render() {
        let { column } = this.state
        return (
            <div style={{ marginTop: '.6rem' }}>
                <Navheader />
                {
                    column.map((item, index) =>
                        <UcCell
                            key={item._id}
                            title={item.title}
                            label={item.des}
                            index={index}
                            to={`/detail/${item._id}?collectionName=column`}
                        />
                    )
                }
            </div>
        )
    }
}
export default withRouter(Column)